
package com.antgroup.seckill.business.common.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wangxy
 * @date 2024/8/4 16:46
 */

@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://localhost:6379") // 替换为实际的 Redis 地址和端口
                .setPassword("123456"); // 如果没有密码，可以删除这行

        return Redisson.create(config);
    }
}
